package com.riven.bilibilidemo.activity;

import android.content.Intent;
import android.os.Parcelable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.riven.bilibilidemo.R;

import org.w3c.dom.Text;

public class ZhiBoActivity extends AppCompatActivity {

    private TextView zhibo_name;
    private TextView zhibo_title;
    private TextView zhibo_id;
    private ImageView zhibo_icon;
    private String title;
    private String name;
    private int online;
    private String image;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zhi_bo);

        Intent intent = getIntent();
        title = intent.getStringExtra("title");
        name = intent.getStringExtra("name");
        online = intent.getIntExtra("online", 0);
        image = intent.getStringExtra("image");
        initView();
    }

    private void initView() {

        zhibo_name = (TextView) findViewById(R.id.zhibo_connect_name);
        zhibo_title = (TextView) findViewById(R.id.zhibo_content_title);
        zhibo_id = (TextView) findViewById(R.id.zhibo_connect_id);
        zhibo_icon = (ImageView) findViewById(R.id.zhibo_connect_icon);

        zhibo_name.setText(name);
        zhibo_title.setText(title);
        zhibo_id.setText(online+"");
        Glide.with(ZhiBoActivity.this).load(image).into(zhibo_icon);
    zhibo_icon.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Intent intent = new Intent(ZhiBoActivity.this, User_connect_Activity.class);

         intent.putExtra("icon", image);
        intent.putExtra("name", name);
        intent.putExtra("title",title);
        startActivity(intent);
    }
    });

    }
}
